package cn.dakaqi.volunteer.insurance.services;

import cn.dakaqi.entities.VolunteerInsurance;
import cn.dakaqi.utils.exception.ServiceRuntimeException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by chunyang on 2016/4/19.
 */
@Component(value = "volunteerInsuranceService")
@Transactional
public class VolunteerInsuranceServiceImpl implements VolunteerInsuranceService
{
    @Autowired
    VolunteerInsuranceDao volunteerInsuranceDao;

    @Override
    public void create(String param) throws ServiceRuntimeException
    {

    }

    @Override
    public VolunteerInsurance save(VolunteerInsurance volunteerInsurance) throws ServiceRuntimeException
    {
        return volunteerInsuranceDao.save(volunteerInsurance);
    }

    @Override
    public VolunteerInsurance findByVolunteerCode(String volunteerCode) throws ServiceRuntimeException
    {
        return volunteerInsuranceDao.findByVolunteerCode(volunteerCode);
    }

    @Override
    public VolunteerInsurance findByVolunteerCodeAndStatus(String volunteerCode, int status) throws ServiceRuntimeException
    {
        return volunteerInsuranceDao.findByVolunteerCodeAndStatus(volunteerCode,status);
    }

    @Override
    public void applyInsurance(String volunteerCode, String guardianName, String guardianIDCard, String guardianMobile)
    {

    }
}
